<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="js/vue.js"></script>
	</head>
	<body>
		<div id="app">
			<button @click="counter++">btn1</button>
			<button @click="counter++">btn2</button>
			<h3>{{counter}}</h3>
			<button-counter></button-counter>
			<button-counter></button-counter>
			<button-counter></button-counter>
		</div>
		<hr />
		<div id="app2">
			<button-counter></button-counter>
			<button-counter></button-counter>
			<button-counter></button-counter>
		</div>
		<script type="text/javascript">
			//全局组件
			const vc = Vue.component('button-counter', {
				template: '<button @click="counter++">++{{counter}}</button>',
				data() {
					return {
						counter: 0
					}
				}
			});
			const vm = new Vue({
				el: '#app',
				data: {
					counter: 0
				} //数据
				// methods:{} 方法
				// computed:{} 计算属性
				// watch:{} 监视器
				// filters:{} 过滤器
				// directives:{} 自定义指令
			})
			// console.dir(vc);
			// console.log("-------------------------");
			console.dir(vm);
			const vm2 = new Vue({
				el: '#app2'
			})
		</script>
	</body>
</html>
